export interface FormPatternItem {
  type: string;
  // 验证和表单对象里面的某个属性都是prop，名字要一样的.
  prop?: string;
  options?: object[];

  // when using el-input-number
  precision?: number;
  max?: number;
  min?: number;
  // width
  width?: string;

  label?: string;
  placeholder?: string | string[];
  offsetList?: number[];
  labelList?: string[];
  keyList?: string[];
  subRule?: object;
  // every item in the keyList is disabled
  isDisabled?: boolean[];
  // if not only using el-input
  itemType?: string[];
  subOptions?: object;

  // when creating form-item-list
  formItemListType?: string;
  insertIndex?: number;
  // e.g rebateTime
  key?: string;
  // call back function
  // callbackFunc?: Function;
}

export interface FormPattern {
  // 表明该表单模板是什么（支出流水？收入流水？等）
  formType: string;
  labelWidth: string;
  formItem: FormPatternItem[][] | FormPatternItem[];
}
// form end

// table interface
export interface TablePattern {
  prop: string;
  label?: string;
  type?: string;
  formatType?: string;
  // 是否显示某一列
  isShow: boolean;
  // 是否固定
  // when using multi
  // multi项最多的row所在的索引
  maxLengthIndex?: number;
  //生成的子表列的插入索引的位置，如“落地机构‘1’分成比例”
  // multi项最多的item数，比如“落地机构的个数”
  maxSubItemNum?: number;
  insertIndex?: number;
  // 生成子表列的数组
  subTitle?: TablePattern[];
  isFixed?: boolean;
}

export interface FileItem {
  name: string;
  url: Blob;
}

// a interface of table row item
export interface TableItem {
  value: object;
  index: number;
}
